package cn.airia.blog.vo
{
	import mx.core.FlexGlobals;

	public class Session
	{
		public static var sessionDate:Object = new Object;
		
		public static var session:Session;
		
		public static function getInstance():Session
		{
			if(session == null)
			{
				session = new Session();
			}
			return session;
		}
		
		public function setAttribut(key:String,value:Object):void
		{
			sessionDate[key] = value;
		}
		
		public function getAttribut(key:String):Object
		{
			if(sessionDate[key]!=null)
			{
				return sessionDate[key];
			}
			return null;
		}
		
		public function removeAttribut(key:String):void
		{
			if(sessionDate[key]!=null)
			{
				delete sessionDate[key];
			}
		}
		
		public function Session()
		{
			var baseInfo:BlogBaseInfoVBean = new BlogBaseInfoVBean();
			baseInfo.blogId = FlexGlobals.topLevelApplication.parameters["blogId"];
			baseInfo.username = FlexGlobals.topLevelApplication.parameters["username"];
			baseInfo.password = FlexGlobals.topLevelApplication.parameters["password"];
			
			setAttribut("baseInfo",baseInfo);
		}
	}
}